// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{235933fa-ea25-4182-bf5e-b5b345111dc8}")]
	#endregion

	#region Documentation
	//1 Spiel-Dimension
	/// Spiel-Dimension:
	/// 
	/// Kreis Mainz, Herren, Saison ...
	#endregion

	#endregion
	public class Spieldimension: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 5);
			public const int Kategorie_MemberIndex = Eco_FirstMember + 0;
			public const int Klasse_MemberIndex = Eco_FirstMember + 1;
			public const int Pokalwettbewerb_MemberIndex = Eco_FirstMember + 2;
			public const int Saison_MemberIndex = Eco_FirstMember + 3;
			public const int Verband_MemberIndex = Eco_FirstMember + 4;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Spieldimension.Eco_LoopbackIndices.Kategorie_MemberIndex), Id="{e581f7f1-7dc5-4dfb-aa25-6de676b4feeb}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SpieldimensionKategorie), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Kategorie Kategorie
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Kategorie) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Kategorie_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Kategorie_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Spieldimension.Eco_LoopbackIndices.Klasse_MemberIndex), Id="{35c81d39-8842-4ead-b2ce-2740ff3069a3}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SpieldimensionKlasse), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Klasse> Klasse
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Klasse>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Klasse_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Spieldimension.Eco_LoopbackIndices.Pokalwettbewerb_MemberIndex), Id="{02fe880f-a75b-455e-81d8-f0832a3c139d}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalwettbewerbSpieldimension), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Pokalwettbewerb> Pokalwettbewerb
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Pokalwettbewerb>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Pokalwettbewerb_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Spieldimension.Eco_LoopbackIndices.Saison_MemberIndex), Id="{e434bd08-670c-415a-ac4a-ff4dbe509f1c}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SaisonSpieldimension), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Saison Saison
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Saison) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Saison_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Saison_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Spieldimension.Eco_LoopbackIndices.Verband_MemberIndex), Id="{be84ae7e-dabc-48eb-a95f-c77c342892c8}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.VerbandSpieldimension), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Verband Verband
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Verband) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Verband_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Verband_MemberIndex, ((object)(value)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Spieldimension(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Spieldimension(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
